<!DOCTYPE html>
<html>
  <head>  
    <% include template/meta %>
    <title><%=global.appConfig.title%></title>
  </head>

  <body>    
  	<div class="main">
      <div id="client-app-banner">
        <div class="app-wrapper">   
          <a href="javascript:;" class="app-close-btn">×</a>     
          <img class="app-icon" src="<%=global.appConfig.shost%>/images/logo/app_icon.png">
          <span class="app-text">
            <strong>淘一个</strong>
            <em>下载手机APP,闪购随时随地</em>
          </span>
          <span class="app-go"></span>
        </div>
      </div> 
  		<header class="index-header">
  			<div class="h-left">
  				<a href="/user/home" class="user-home">
            用户中心<b <%if(user){%>class="user-online"<%}%>></b>
          </a>
  				<div class="h-slogan">
  					<span>闪淘五湖四海</span>
  					<span>精选万里挑一</span>
  					<span>直邮千家万户</span>
  					<span>承诺假一赔十</span>
  				</div>
  			</div>
  			<div class="h-right">
  				<a href="/" class="logo">淘一个</a>
  			</div>
  		</header>
  		<!-- 今日抢购 -->
  		<div id="sale-today">
        <%if(product){%>
        <input type="hidden" id="today-product-id" value="<%=product.id%>"/>
        <a href="/html/products/product_<%=product.id%>.html" class="p-image-box">
        	<img alt="<%=product.title%>" src="<%=product.largeImageUrl[0]%>"/>
        </a>
        <p class="p-title">
          <%=product.title%>      
        </p>
  			<ul class="sale-desc clearfix">
  				<li class="p-salevolume"><span class="p-icon"></span><label>已售：<span></span>件</label></li>
				<li class="p-store"><span class="p-icon"></span><label>库存：<span></span>件</label></li>
  			</ul>
  			<div class="p-action clearfix">
  				<div class="left">
  					<label class="p-nowprice">
              <strong>
              ￥<%=product.price%>
              </strong>  
              <span class="p-tags">
                <span class="p-nochange">一口价</span>
                <span class="p-discount">
                <%=(Math.round(product.price/product.oriPrice*100)/10)%>折
                </span>                
              </span>            
            </label>
            <label class="p-additional">
              <span class="p-price">
                市场价:
                <span>￥</span><del><%=product.oriPrice%></del>
              </span>
            </label>
  				</div>
  				<div class="right">  					
  					<a href="javascript:;" class="btn-shopping-now <%if(product.count<1||product.saleStartTime>Date.now()){%>disable<%}%>">立即闪购</a>
  				</div>
  			</div>
        <%}else{%>
          <a class="p-image-box">
            <span class="tyg-waiting">敬请期待...</span>
          </a>
        <%}%>
  		</div>
  		<!-- 即将开始 -->
  		<table id="table-sale-soon">
      <%readylist.forEach(function(val){ 
        var p = JSON.parse(val);
        if(new Date(p.saleStartTime).getDate()==new Date(Date.now()+1000*3600*24).getDate()){%>
  			<tr>
  				<td>
  					<a href="javascript:;" class="title">
  						即将开始<b class="arrow-right"><b>
  					</a>
  				</td>
  				<td>
	  				<a href="/html/products/product_<%=p.id%>.html" class="cont">
	  					<img src="<%=p.bannerUrl%>"/>
	  				</a>	
  				</td>
  			</tr>
        <%}})%>
  		</table>
  		<!-- footer -->
      <% include template/user_footer %>
      <!-- script -->
      <script type="text/javascript">
        require(['jquery','main'],function ($,main) {
          main.getProductInfo();
        })
      </script>
  	</div>
    <!-- 客服代码 -->
    <script src="https://s.meiqia.com/js/unit/button.js?id=3642" charset="UTF-8"></script>
    <!-- CNZZ统计 -->
    <script type="text/javascript">var cnzz_protocol = (("https:" == document.location.protocol) ? " https://" : " http://");document.write(unescape("%3Cspan style='display:none;' id='cnzz_stat_icon_1253476325'%3E%3C/span%3E%3Cscript src='" + cnzz_protocol + "v1.cnzz.com/stat.php%3Fid%3D1253476325%26show%3Dpic1' type='text/javascript'%3E%3C/script%3E"));</script>        
  </body>
</html>
